﻿
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" name="viewport" content="text/html; charset=utf-8" />
    <title>用户登录</title>
    @Html.Raw(ViewBag.js)
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="/css/lr.css" />

    <script src="/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
      
	$('#login').click(function() {
		var name_state = $('#name');
		var psd_state = $('#psd');
		var name = $('#name').val();
		var psd = $('#psd').val();
		var vcode = $("#vcode");
		var vcode_v = $("#vcode").val();
		if (vcode_v=="") {
		    vcode.parent().next().next().css("display", "block");
		    return false;
		}else if (name == '') {
			name_state.parent().next().next().css("display", "block");
			return false;
		} else if (psd == '') {
			name_state.parent().next().next().css("display", "none");
			psd_state.parent().next().next().css("display", "block");
			return false;
		} else {
			name_state.parent().next().next().css("display", "none");
			psd_state.parent().next().next().css("display", "none");
			$('.login').submit();
		}
	});
	
})

function ok_or_errorBylogin(l) {
	var content = $(l).val();
	if (content != "") {
		$(l).parent().next().next().css("display", "none");
	}
}

function ResetVCode() {


    $("#imgvcode").attr("src", "/M/VCode?m=" + Date());

}
    </script>
</head>

<body class="login_body">

    <div class="login_div">
        <div class="col-xs-12 login_title">登录</div>
        <form action="" class="login" method="post">
            <div class="nav">
                <div class="nav login_nav">
                    <div class="col-xs-4 login_username">
                        用户名:
                    </div>
                    <div class="col-xs-6 login_usernameInput">
                        <input type="text" name="name" id="name" value="" placeholder="&nbsp;&nbsp;用户名" onblur="javascript:ok_or_errorBylogin(this)" />
                    </div>
                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="nav login_psdNav">
                    <div class="col-xs-4">
                        密&nbsp;&nbsp;&nbsp;码:
                    </div>
                    <div class="col-xs-6">
                        <input type="password" name="password" id="psd" value="" placeholder="&nbsp;&nbsp;密码" onBlur="javascript:ok_or_errorBylogin(this)" />
                    </div>
                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="nav register_affirm">
                    <div class="col-xs-4">
                        验证码:
                    </div>
                    <div class="col-xs-6">
                        <input type="text" name="vcode" id="vcode" value="" placeholder="&nbsp;&nbsp;验证码" onBlur="javascript: ok_or_errorBylogin(this)" />
                        <a href="#" onclick="ResetVCode()" > <img id="imgvcode" name="imgvcode" alt="换一张" src="/M/VCode" /></a>
                    </div>

                    <div class="col-xs-1 ok_gou">
                        √
                    </div>
                    <div class="col-xs-1 error_cuo">
                        ×
                    </div>
                </div>
                <div class="col-xs-12 login_btn_div">
                    <input type="submit" class="sub_btn" value="登录" id="login" />
                </div>
            </div>
        </form>

        <div class="col-xs-12 barter_btnDiv">
            <a class="barter_registerBtn" href="/M/Register" style="">没有帐号?注册新用户</a>
        </div>
    </div>

   

</body>
</html>